[XEN] add typed p2m entry-setting function
authorTim Deegan <Tim.Deegan@xensource.com>
Fri, 14 Sep 2007 08:52:47 +0000 (09:52 +0100)
committerTim Deegan <Tim.Deegan@xensource.com>
Fri, 14 Sep 2007 08:52:47 +0000 (09:52 +0100)
keeping the old one as a fallback for RAM mappings.
Signed-off-by: Tim Deegan <Tim.Deegan@xensource.com>
xen/arch/x86/mm/p2m.c
xen/include/asm-x86/p2m.h

index 8d8f4e5945e1c3f927cd8466e219e9ad867af184..3c03ed1fc733570705a171930a52759cfb2d43f6 100644 (file)
@@ -679,8 +679,8 @@ guest_physmap_remove_page(struct domain *d, unsigned long gfn,
 }
 
 void
-guest_physmap_add_page(struct domain *d, unsigned long gfn,
-                       unsigned long mfn)
+guest_physmap_add_entry(struct domain *d, unsigned long gfn,
+                        unsigned long mfn, p2m_type_t t)
 {
     unsigned long ogfn;
     p2m_type_t ot;
@@ -727,8 +727,7 @@ guest_physmap_add_page(struct domain *d, unsigned long gfn,
 
     if ( mfn_valid(_mfn(mfn)) ) 
     {
-        set_p2m_entry(d, gfn, _mfn(mfn),
-                  p2m_type_to_flags(p2m_ram_rw)|__PAGE_HYPERVISOR|_PAGE_USER);
+        set_p2m_entry(d, gfn, _mfn(mfn), p2m_type_to_flags(t));
         set_gpfn_from_mfn(mfn, gfn);
     }
     else
index ff00bbd4faac84f965428093023ab82f41435923..649f4747f50541e4fddfcdb0995f3145c3541d39 100644 (file)
@@ -201,8 +201,15 @@ int p2m_alloc_table(struct domain *d,
 void p2m_teardown(struct domain *d);
 
 /* Add a page to a domain's p2m table */
-void guest_physmap_add_page(struct domain *d, unsigned long gfn,
-                            unsigned long mfn);
+void guest_physmap_add_entry(struct domain *d, unsigned long gfn,
+                             unsigned long mfn, p2m_type_t t);
+
+/* Untyped version for RAM only, for compatibility */
+static inline void guest_physmap_add_page(struct domain *d, unsigned long gfn,
+                                          unsigned long mfn)
+{
+    guest_physmap_add_entry(d, gfn, mfn, p2m_ram_rw);
+}
 
 /* Remove a page from a domain's p2m table */
 void guest_physmap_remove_page(struct domain *d, unsigned long gfn,